^^ limitation

Don Clugston dac at nospam.com
Wed Apr 25 01:09:43 PDT 2012


On 24/04/12 23:00, Tyro[17] wrote:
> I believe the following two lines of code should produce the same
> output. Is there a specific reason why doesn't allow this? Of course the
> only way to store the result would be to put in into a BigInt variable
> or convert it to string but I don't that shouldn't prevent the compiler
> from producing the correct value.
>
> (101^^1000).to!string.writeln;
> (BigInt(101)^^1000).writeln;
>
> Regards,
> Andrew

Because BigInt is part of the library, not part of the compiler, so the 
compiler doesn't know it exists.

What would be the type of 3^^5 ? Would it be a BigInt as well?

This kind of thing doesn't work well in C-family languages.


More information about the Digitalmars-d mailing list