Click to See Complete Forum and Search --> : Negative zero?
JuggaloBrotha
Jan 2nd, 2010, 02:30 PM
Apparently some government apps allow it:
75340
RhinoBull
Jan 2nd, 2010, 03:02 PM
In mathematics it’s quite acceptable - it's also known as "signed zero (http://en.wikipedia.org/wiki/Signed_zero)".
dilettante
Jan 2nd, 2010, 03:14 PM
I can think of at least two reasons for this:
Some CPUs handle numbers (either or both integer and real values) as signed magnitudes. So a "-0" can be legit even though equality tests will compare them as equal.
The value may be close to zero but rounded off retaining the sign (-0.2 rounded to -0).
Actually some CPUs and memory even have "out of band" bits a user-mode program can't see. These often include a parity bit but may even include "tag" bits that determine the type of data stored in the word. Such a processor may not allow "code" with the wrong tag values to be excuted for example. Other tag values may be required for a word to be used as a pointer or memory descriptor. Some tag values get used for things like stack-frame markers.
Such machines are much harder to write malware exploits for. Buffer overruns aren't a problem because arrays are bracketed by tags saying "can't be written by user-mode code" and trying to write "off the end" results in an interrupt caught by the OS.
Even x86/x64 CPUs are gaining these sorts of "smarts" to enable things like hardware DEP and memory management enhancements. With RAM so cheap I'm surprised we haven't seen tagged memory come into vogue for microprocessors like these yet. As far as I know there aren't any "Wintel" machines using such things yet though, at least not beyond parity and ECC.
Lord Orwell
Jan 2nd, 2010, 03:19 PM
its also possible they were originally working in celsius -18 and their converter uses the absolute value and keeps the sign.
dbasnett
Jan 4th, 2010, 11:22 AM
http://www.crh.noaa.gov/ddc/?n=windchill
But is -0 colder than +0, because we are not having Global Warming in Missouri anytime soon and it feels like it must be -0!
chris128
Jan 6th, 2010, 12:23 PM
I thought this thread was going to be about the user on here named Negative0 :(
JuggaloBrotha
Jan 6th, 2010, 01:03 PM
I typed out the word for 0 for that reason, http://forecast.weather.gov hasn't given me a -0 for the temp since that day either.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.