venta: (Default)
[personal profile] venta
A quick question for Visual Studio users (with an ancillary part for anyone who writes C/C++/possibly Java/possibly others). Throughout the following, I mean {} or () by "brackets" :)

Is there an option anywhere in Visual Studio which I can set which means that when I highlight/hover over a bracket, it will in some way highlight or indicate its matching friend ? Yes, I know when you first close your brackets they're in bold text, but that goes away as soon as you start typing something else.

I just asked a VS user here, and he (a) had no idea and (b) seemed baffled I'd want that. Now, up until this recent enforced flirtation with VS I've written C/C++ exclusively in Emacs. Which allows you to set all kinds of different manners of highlighting for brackets. I find it phenomenally useful and am currently boggled that any serious text editor intended for programming doesn't offer this.

So... is this a reasonable thing to want to, or a strange quirk of mine bred by too much use of Emacs ? And, more importantly, can I make VS do it ?

Irrelevantly, just because I want to know:

[Poll #1028846]

Date: 2007-07-27 05:08 pm (UTC)
From: [identity profile] hjalfi.livejournal.com
I have just been doing float-point implementation on PowerPC.

Arrgh.

However, if you want a chunk of BSD-licensed code that calculates 4 or 8 byte IEEE floating point constants from a string representation, I know where to get one...

Date: 2007-07-27 05:14 pm (UTC)
From: [identity profile] venta.livejournal.com
Today, I encountered the scariest bit of code I've ever seen (which relied on IEEE float format). It was a quick square-root function for 16.16 fixed point input, and utilised this:

http://blog.int6.net/wp-content/uploads/2006/10/FastInverseSqrt.pdf

Which (until I googled for the magic number and found the above) was wildly impenetrable.

Date: 2007-07-27 05:26 pm (UTC)
From: [identity profile] hjalfi.livejournal.com
That is deeply impressive. I'll have to remember that.

Oddly enough, the PowerPC (yes, I've been spending far too much time immersed in that sodding "what do you mean, the R in RISC stands for 'reduced'?" abomination of a "of *course* it makes sense to number bits with 0 as the MSB and 31... er, 63... er, n as the LSB" processor) has an instruction, frsqrte, that calculates exactly this:

http://www.nersc.gov/vendor_docs/ibm/asm/frsqrte.htm

It could well use that algorithm...

Date: 2007-07-30 09:55 pm (UTC)
From: [identity profile] two-nukes.livejournal.com
Ah, that old chestnut, it's been in the 3d games community for yonks as a fast square root used to normalise vectors, though don't think it's used as much now since the vector instructions of a lot of modern processors generally implement a fast approximate reciprocal square root for this sort of thing these days.

Good old Newton Raphson root finder with a sneeky initial approximation using the fact that IEEE FP have exponent and mantissa, halving the exponent is always a good way of starting to head towards the sqrare root.

Profile

venta: (Default)
venta

December 2025

S M T W T F S
 123456
78910111213
14151617181920
212223 24252627
28293031   

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Dec. 27th, 2025 05:50 am
Powered by Dreamwidth Studios