The Argument sArg needs to be parsed as a string when partial tag names are used for the association ie "?1?".Įg where the substitution is a valid equipment reference and ?INT 1?.HourRun is a valid em reference to a tag.Ġ - Tag reference as defined in sArg. When you associate a partial variable tag name (or partial em to reference variable tag) a prefix or suffix needs be added to the association to form a valid tag reference. For example, if you want information about the variable that replaced substitution string Which substitution string it replaced when the associationĮnter the argument number or name (substitution string number or name) of the relevant substitution string. The sArg argument allows you to get informationĪbout one of those variable tags. Super Genie substitution strings are replaced by variable When you associate variable tags (can use em to reference the variable tag) with Super Genies, the Please be aware that if you are replacing an instance of AssInfo with AssInfoEx in a loop, you may want to make AssInfoEx blocking using the iCached argument to verify you are using the correct value for the Tag in your logic. In a large number of cases AssInfo can be replaced with AssInfoEx using Find and Replace (see Using Find and Replace in a project). In addition, the function AssInfoEx has been introduced to make it easier to make legacy Cicode compatible with online changes. If the Tag properties are updated, AssInfo does not get the updated values whereas AssGetProperty does. Java Result: 1Great, a new exception.Note: In some cases it may be beneficial to replace AssInfo with either the AssGetProperty or the AssInfoEx function. } Exception in thread "main" : Invalid operationĪt (BigDecimal.java:1932) Well, now that it's not the size of the number, lets just shoot in the dark and get more accuracy!īigDecimal num = new BigDecimal(reallybig) //bigger the number, the harder and more accurately e is calculatedīigDecimal finl = ((BigDecimal.ONE).add((BigDecimal.ONE).divide(num))).pow((num.intValue()), prsc) For example, 75000 was what I kept trying and getting an error with, but when I tried 80000 it worked. I'm finding that it's not just the large size of the number, but just a specific number that causes it to throw the error mentioned above. Under a second to complete the process with an added precision/MathContext thing is just as accurate. Unfortunately it didn't remedy the problem.īigDecimal finl = ((BigDecimal.ONE).add((BigDecimal.ONE).divide(num)).setScale(10, RoundingMode.UP)).pow(num.intValue()) Edited by: kavon89 on 1:17 AMĮdited by: kavon89 on 1:52 AM - Fixing up typos before going to bed.Īfter sifting through the API some more, I've found MathContext fixes the inefficiency. I'm pretty sure I'm using a valid representation of e, any ideas?ĮDIT: was using NetBeans' pink highlight feature to get the parentheses to match up with each other and remove excess or unpaired ones. It has the same accuracy as far as I can tell, both produce the same number up to 30+ places.Ī "num" value like 75000 or anything larger still throws the exception even with the scaling and rounding.
CITECT INT DECIMAL PLACE CODE
However this code takes 32 seconds to complete, whereas my original takes 8 seconds. }I would have expected this to be less accurate and take less time because it is using a decimal rounded to the 10th place. Interesting findings when I use a scale and round:īigDecimal finl = (BigDecimal.ONE).add(((BigDecimal.ONE).divide(num)).setScale(10, RoundingMode.UP)).pow(num.intValue()) 75,000 = BUG: "Non-terminating decimal expansion no exact representable decimal result." :( Edit Here is the exact error when I use a large number like 75000:Įxception in thread "main" : Non-terminating decimal expansion no exact representable decimal result.Īt (BigDecimal.java:1514) My testing of diffrent values for "num": What am I doing wrong?īigDecimal num = new BigDecimal(25000) //bigger the number, the harder and more accurately e is calculatedīigDecimal finl = (BigDecimal.ONE).add(((BigDecimal.ONE).divide(num))).pow(num.intValue()) I thought BigDecimal would allow me to do this type of operation. Currently it is only accurate to about 5ish places and caps out with an error. I have a program which calculates the value of e, however it will not let me increase the accuracy of the calculation. 1.7K Training / Learning / Certification.165.3K Java EE (Java Enterprise Edition).7.8K Oracle Database Express Edition (XE).3.7K Java and JavaScript in the Database.