By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,761 Members | 1,183 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,761 IT Pros & Developers. It's quick & easy.

System.Math.Log10 returning different values on different OS

P: n/a

Here is an update.

There is no differences with the function
System.Math.Log10 under any operating system.

The problem is with the casting of the datatype double
and value Infinite to datatype int.

double myValue = System.Math.Log10(0d);
// myValue = Infinite
int myIntValue = (int)myValue]
// myIntValue = -2147483648 under Framework 1.1 in
Windows XP Pro
// myIntValue = 0 under Framework 1.1 in Windows NT SP6a
// myIntValue = 3622256 under Framework 2.0 in Windows XP

So as you can see there is a bug with casting Infinite to

I've raised it with Microsoft.

-----Original Message-----
In Windows XP
System.Math.Log10(0) returns -2147483648

In Windows NT
System.Math.Log10(0) returns 0.

Does anyone know why?



Nov 16 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.