Operator problems for large integers

General discussions related to APLNext's VisualAPL.

Moderators: Tech Support, phpbb_admin

Operator problems for large integers

Postby Chris McIntosh » August 3rd, 2011, 2:19 pm

Untyped numeric variables seem perfectly capable of holding large (ie. 12 digit) integers, but there seem to be problems using them.

Below is code that illustrates this.

// Use all untyped vars, they work to a point.
// Keys are of the form "DDDDDD-DDDDDD"
Chris McIntosh


Postby joe_blaze » November 28th, 2011, 3:24 pm

The error message '...BigIntWontFitInt...' indicates that the operation (in this case subtraction) would create an object which would not satisfy the criteria for a 'BigInt' data type.

Currently VisualAPL, by design, provides this error message instead of 'promoting' the values to doubles with an inherent loss of precision. This is different than some other APL implementations.
Posts: 383
Joined: February 11th, 2007, 3:09 am
Location: Box 361 Brielle, NJ 08730-0361

Postby Chris McIntosh » December 1st, 2011, 5:16 pm

Hi, Joe,

If I'm strongly typing variables then I can understand how my strong typing might cause VisualAPL grief, and interfere with it's normal operations. I can understand how you probably wouldn't want automatic conversions going on that might result in loss of precision.

However if I just assign variables, and let VisualAPL choose it's internal cvar type for me, I would hope it would be able to be internally consistent so that these types of operations would just work.

My own opinion is that if code that I'll call "raw APL" (no input/output to/from devices or the screen, just computation using traditional APL functions and operators) works correctly in APL+WIN, it should also work correctly in VisualAPL.

The only reason for the subtraction above is to try and get numbers into a more reasonable range. The only reason for doing this is because operations weren't working correctly with the original large numbers.

My own opinion is that what I'm trying to do above is not particularly esoteric, but pretty basic and should work.

I will try this out in your latest release and let you know what results I get.

Thanks for the new release.

Chris McIntosh

Return to VisualAPL

Who is online

Users browsing this forum: No registered users and 1 guest