This is an interesting point. Both Java and C(++) would by definition use libraries for this 128 bit fp data type and operations. Even if C#'s decimal type is supported by the language, it is not supported by any piece of hardware and is therefore implicitly library based. GMP, an example of a world class Big Number library, wouldn't be any less consistent than probably already exists between C# and Java. Especially since BigDecimal is NOT based upon fp operations.<br> <br> It would actually be very interesting (though off topic) to write the native code to integrate GMP into Java, and then test how close a mpf_t with mantissa=96 approximates the behavior of BigDecimal as used in Java SDL. If anyone ever wants to do this, consider me a volunteer for the project :)<br> <br> Eric<br> <br><b><i>"J. David Beutel" <jdb@getsu.com></i></b> wrote:<blockquote class="replbq" style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;">
Is the issue here that the 128-bit decimal number is inconsistent in the <br>C++ library? If so, then another option is to support it but just let <br>it be inconsistent. Or does SDL have a use-case for inter-platform <br>communication? Unless all of the application's math remains inside SDL, <br>such inconsistency seems inevitable with mixed languages and platforms. <br>Is it better to have consistency within a given platform?<br><br>Cheers,<br>11011011<br><br>"Daniel Leuck" <dan @ikayzo.com=""> wrote on Monday, November 13, 2006 09:38:27:<br>><br>> So you vote for #2? Does anyone else have an opinion?<br>><br>> <br>><br>> BTW- I included decimal because two of our users in the finance sector <br>> wanted a type accurate enough to handle currency. In Java this means <br>> BigDecimal. In C# "decimal" is used.<br>><br>> <br>><br>> ------------------------------------------------------------------------<br>><br>> *From:*
Jesse Weaver [mailto:pianohacker@gmail.com]<br>> *Sent:* Monday, November 13, 2006 8:52 AM<br>> *To:* sdl-developers@ikayzo.org<br>> *Subject:* Re: FW: Couple of things<br>><br>> <br>><br>> <br>><br>> On 11/13/06, *Daniel Leuck* <dan @ikayzo.com=""><mailto:dan @ikayzo.com="">> <br>> wrote:<br>><br>> Hi Jesse,<br>><br>> <br>><br>> The Mono issue appears to be a bug with the Mono compiler (those two <br>> interface methods are not ambiguous), but I will look into what can be <br>> done.<br>><br>> Re: I would think that a 32-bit integer and a 64-bit floating<br>> point would be enough.<br>><br>> <br>><br>> The two options I would consider are:<br>><br>> 1. Make the 128 bit decimal type an optional feature.<br>> 2. Redefine decimal as the most accurate decimal type available<br>> on the platform.<br>><br>> <br>><br>> I am
leaning strongly towards one because I don't like the notion<br>> of something having significantly different meaning on different<br>> platforms. Any objections?<br>><br>> <br>><br>> Dan<br>><br>> <br>><br>><br>> Well, there is one problem: right now, Java and C# support the 128-bit <br>> number, and C++ won't. This effectively means that we'll have two <br>> versions of the SDL language. Since the decimal type is probably only <br>> needed for special uses, this should be okay, but it could lead to <br>> problems down the road.<br>><br>> -- <br>> Jesse<br>><br>> -----------<br>> There is a theory which states that if anybody ever discovers exactly <br>> what the Universe is for and why it is here, it will instantly <br>> disappear and be replaced by something even more bizarre and <br>> inexplicable. There is another theory which states that this has <br>> already happened.
- Douglas Adams, author of Hitchhiker's Guide to the <br>> Galaxy<br>><br><br><br></mailto:dan></dan></dan></blockquote><br><BR><BR>"Those who would give up essential liberty to purchase<br>a little temporary safety deserve neither liberty nor<br>safety." -- B. Franklin