Thread overview
BigDecimal D library (incomplete, very early stages) - BigDecimal.d
Oct 03, 2004
ajvincent
Re: BigDecimal D library
Oct 03, 2004
ajvincent
[OT] garbled attachment (was Re: BigDecimal D library)
Oct 04, 2004
J C Calvarese
Oct 04, 2004
John Reimer
Oct 05, 2004
ajvincent
October 03, 2004
I've implemented comparisons, addition, subtraction, and multiplication. Division and modulus operations I will work on probably later... today, actually, given that it's now after midnight...

I've also made an effort in this code to be forward-thinking.  The design of the code has two features not included in my JavaScript library.  (1) It will be able to support use as a Mozilla XPCOM (and probably other forms of COM, including MSCOM) component.  (2) Upgrading it from using long types in its digit array to cent types is intended to be a one-line change.  So you'd be able to more than double the number of digits (18 digits for long, 38 for cent) that the library supports.

With debug and unittest enabled, it runs a rather brutal test suite.  The test suite dynamically generates long values and uses them as checks against what the library code outputs.  So far, it passes the test suite (though it fails a test case with a NaN value passed to it, and I had to comment that out).

I would greatly appreciate feedback on this code.  Please bear in mind that this is my *first* time writing D code, and I've been using this project mainly to teach myself D.  So there are going to be some rough areas!  Based on what I picked up from the D spec, I tried to include comments on what I think these areas are.


October 03, 2004
Sorry, I guess that attachment got mangled, as I couldn't read it, even after clicking on the message's provided link.

http://weblogs.mozillazine.org/weirdal/archives/006620.html http://weblogs.mozillazine.org/weirdal/archives/BigDecimal.d


October 04, 2004
ajvincent@gmail.com wrote:
> Sorry, I guess that attachment got mangled, as I couldn't read it, even after
> clicking on the message's provided link.

Actually, it's not so much garbled as encoded.  I could view the attachment in a newsreader (Thunderbird).

For whatever reason, some attachments can't be downloaded from the web interface. Here's some more information about the web interface vs. newsreader advantages/disadvantages in the comments section at
http://www.prowiki.org/wiki4d/wiki.cgi?NewsDmD


> http://weblogs.mozillazine.org/weirdal/archives/006620.html
> http://weblogs.mozillazine.org/weirdal/archives/BigDecimal.d

On the other hand, these links should work great for everyone. Thanks.

-- 
Justin (a/k/a jcc7)
http://jcc_7.tripod.com/d/
October 04, 2004
ajvincent@gmail.com wrote:
> Sorry, I guess that attachment got mangled, as I couldn't read it, even after
> clicking on the message's provided link.
> 
> http://weblogs.mozillazine.org/weirdal/archives/006620.html
> http://weblogs.mozillazine.org/weirdal/archives/BigDecimal.d
> 
> 

Is there something wrong with the attachment?  I was able to download it  fine into my newsreader (Thunderbird on win XP).  No mangling issues visible at all.
October 05, 2004
>Is there something wrong with the attachment?  I was able to download it
>  fine into my newsreader (Thunderbird on win XP).  No mangling issues
>visible at all.

I think it's a bug through the web-based access to this newsgroup.  Although you just gave me a good reason to use Thunderbird.

(And for the record, I'm a big Mozilla supporter, at least emotionally.  It's the primary application I tinker with, and tonight I'm planning on blogging about a "little" bug in it...)

Alex Vincent
http://weblogs.mozillazine.org/weirdal