www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - BigInteger fails to construct DMD .91

reply hellcatv hotmail.com writes:
import etc.bigint_files.bigint;

int main () {
Int i = new Int("1");
return 0;
}

$ test.exe
Error: AssertError Failure etc\bigint_files\radix.d(170)


this works fine using gdc

any ideas? Jill?  I've unfortunately got to get a string->bigint.
I'm not sure why it works fine on gdc and asserts on dmd.exe
can you verify (this is
Digital Mars D Compiler v0.91
Copyright (c) 1999-2004 by Digital Mars written by Walter Bright)
Jun 03 2004
next sibling parent Arcane Jill <Arcane_member pathlink.com> writes:
In article <c9mu77$26jc$1 digitaldaemon.com>, hellcatv hotmail.com says...
import etc.bigint_files.bigint;

int main () {
Int i = new Int("1");
return 0;
}

$ test.exe
Error: AssertError Failure etc\bigint_files\radix.d(170)

Don't worry - you keep finding em and I'll keep fixing em. I'll let you know when it's done. Jill
Jun 03 2004
prev sibling parent reply "Ivan Senji" <ivan.senji public.srce.hr> writes:
<hellcatv hotmail.com> wrote in message
news:c9mu77$26jc$1 digitaldaemon.com...
 import etc.bigint_files.bigint;

shouldn't you import etc.bigint?
 int main () {
 Int i = new Int("1");
 return 0;
 }

 $ test.exe
 Error: AssertError Failure etc\bigint_files\radix.d(170)


 this works fine using gdc

 any ideas? Jill?  I've unfortunately got to get a string->bigint.
 I'm not sure why it works fine on gdc and asserts on dmd.exe
 can you verify (this is
 Digital Mars D Compiler v0.91
 Copyright (c) 1999-2004 by Digital Mars written by Walter Bright)

Jun 03 2004
parent reply Arcane Jill <Arcane_member pathlink.com> writes:
Bug now fixed.

That was a silly one. Basically I did a check that the length of the string was
greater than one in order to check for prefixes like "0x". But I screwed up what
it was supposed to do if it wasn't. Anyway, all done now.


In article <c9nfua$30g5$1 digitaldaemon.com>, Ivan Senji says...
 import etc.bigint_files.bigint;

shouldn't you import etc.bigint?

Either will work. Although I had intended that the shorter import would be what people would use, the supporting files are not actually private, and it is ok to import them separately if you don't need the whole package. By importing etc.bigint_files.bigint you are giving yourself the basic Int functionality, but you lose functions like square root. This is an "unadvertized" thing to do, but it's harmless. Arcane Jill
Jun 03 2004
parent Daniel Horn <hellcatv hotmail.com> writes:
cool
I can't get it to compile with debug symbols anymore.

$ dmd *.d etc/*.d etc/bigint_files/*.d etc/workaround/*.d
c:\dmd\dmd\bin\..\..\dm\bin\link.exe 
Accelerator+BigRational+Geometry+Ray+Scene+
ftoa+main+vec+bigint+prime+bigint+exception+factorial+gcd+lowlevel+modexp+modinv
+multiply+prime+radix+squareroot+types,,,user32+kernel32/noi;

works

$ dmd -debug -g *.d etc/*.d etc/bigint_files/*.d etc/workaround/*.d
c:\dmd\dmd\bin\..\..\dm\bin\link.exe 
Accelerator+BigRational+Geometry+Ray+Scene+
ftoa+main+vec+bigint+prime+bigint+exception+factorial+gcd+lowlevel+modexp+modinv
+multiply+prime+radix+squareroot+types,,,user32+kernel32/co/noi;
OPTLINK (R) for Win32  Release 7.50B1
Copyright (C) Digital Mars 1989 - 2001  All Rights Reserved

prime.obj(prime)
  Error 42: Symbol Undefined 
_D3etc5prime7isPrimeFkZC3etc10workaround5types4Bool
--- errorlevel 1

I haven't been able to track this down unfortunately--it seems that 
etc/primes.d defines said function...so I'm not sure why dmd is going crazy.

Arcane Jill wrote:
 Bug now fixed.
 
 That was a silly one. Basically I did a check that the length of the string was
 greater than one in order to check for prefixes like "0x". But I screwed up
what
 it was supposed to do if it wasn't. Anyway, all done now.
 
 
 In article <c9nfua$30g5$1 digitaldaemon.com>, Ivan Senji says...
 
import etc.bigint_files.bigint;

shouldn't you import etc.bigint?

Either will work. Although I had intended that the shorter import would be what people would use, the supporting files are not actually private, and it is ok to import them separately if you don't need the whole package. By importing etc.bigint_files.bigint you are giving yourself the basic Int functionality, but you lose functions like square root. This is an "unadvertized" thing to do, but it's harmless. Arcane Jill

Jun 03 2004