CD \libsf\source\xbase\bignum\ MODIFY PROJECT project\bignum.pjx DO bp DO go *MODIFY FORM frmTest.scx *MODIFY CLASS bignum OF bignum.vcxBasically you drop the bignum class onto a form, and name it "bn". Then, to allocate a big number, use:
lnId1 = thisForm.bn.new() && By default it uses 256-bit precision (you can change it on a class property) lnId2 = thisForm.bn.new(512) && An example using 512-bit precision by single instance override lnId3 = thisForm.bn.new(1024, .t.) && Use 1024-bit precision, and store 1024 as the new default * In general, if you take the number of significant digits you want in base 10, and multiply by 3.3333333, and * round up to the nearest 64 bits, that's how big you need your value to be. * Using this bignum class will allow access to numbers that are literally megabytes long. * You could find the next prime number. :-)This returns an ID which lets you use it in later computations. To set a value:
thisForm.bn.set(lnId, "1234.56") lcValue = thisForm.bn.to_text(lnId)To do calculations, do things like this:
thisForm.bn.mul(lnId1, lnId2) && Multiply the lnId1 bignum by the lnId2 bignum and store the result in lnId1 thisForm.bn.div(lnId1, lnId2) && Divide the lnId1 bignum by the lnId2 bignum and store the result in lnId1 * et ceteraI'll post an update when I get the remaining issues sorted out.