|
-
Jan 2nd, 2010, 02:30 PM
#1
Negative zero?
Apparently some government apps allow it:
Attachment 75340
Last edited by JuggaloBrotha; Jun 30th, 2010 at 03:05 PM.
-
Jan 2nd, 2010, 03:02 PM
#2
Re: Negative zero?
In mathematics it’s quite acceptable - it's also known as "signed zero".
-
Jan 2nd, 2010, 03:14 PM
#3
Re: Negative zero?
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.
-
Jan 2nd, 2010, 03:19 PM
#4
Re: Negative zero?
its also possible they were originally working in celsius -18 and their converter uses the absolute value and keeps the sign.
-
Jan 4th, 2010, 11:22 AM
#5
Re: Negative zero?
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!
-
Jan 6th, 2010, 12:23 PM
#6
Re: Negative zero?
I thought this thread was going to be about the user on here named Negative0
-
Jan 6th, 2010, 01:03 PM
#7
Re: Negative zero?
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|