Size limit on files in AniDB / Invalid ID [trackered]

already fixed bugs

Moderator: AniDB

Elberet
Posts: 778
Joined: Sat Jul 19, 2003 8:14 pm

Post by Elberet »

In Perl, everything is a scalar. Strings, floats, integers - all the same. You can read a number of any length into such a scalar, but only as a string. As soon as you do arithmetic operations with the scalar, it's converted to a signed int or double value.
exp
Site Admin
Posts: 2438
Joined: Tue Oct 01, 2002 9:42 pm
Location: Nowhere

Post by exp »

Elberet wrote:In Perl, everything is a scalar. Strings, floats, integers - all the same. You can read a number of any length into such a scalar, but only as a string. As soon as you do arithmetic operations with the scalar, it's converted to a signed int or double value.
yep,

right now I do some arithmetics in the size handling though (i.e. to insert the dots before displaying a size value anywhere). I could probably do that with string operations too. However, I am not sure what perl will do on other arithmetic checks which i will still need. (i.e. < and >)

BYe!
EXP
Elias
Posts: 242
Joined: Tue Feb 17, 2004 4:55 pm

Post by Elias »

I think Math.BigInt (or Math.BigFloat) package will be enough for this purpose. All operations are covered, maybe conversion BigInt -> string (to write to DB or display) may be improved.
Locked