MCPcopy Create free account
hub / github.com/AstroImageJ/astroimagej / parseInt

Method parseInt

ij/src/main/java/ij/macro/Functions.java:3799–3819  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3797 }
3798
3799 double parseInt() {
3800 String s = getFirstString();
3801 int radix = 10;
3802 if (interp.nextToken()==',') {
3803 interp.getComma();
3804 radix = (int)interp.getExpression();
3805 if (radix<2||radix>36) radix = 10;
3806 }
3807 interp.getRightParen();
3808 double n;
3809 try {
3810 if (radix==10) {
3811 n = parseDouble(s);
3812 if (!Double.isNaN(n)) n = Math.round(n);
3813 } else
3814 n = Integer.parseInt(s, radix);
3815 } catch (NumberFormatException e) {
3816 n = Double.NaN;
3817 }
3818 return n;
3819 }
3820
3821 @AstroImageJ(reason = "Move printToWindow invocation to the render thread", modified = true)
3822 void print() {

Callers 15

getFunctionValueMethod · 0.95
IJClass · 0.80
setPlotFormatFlagsMethod · 0.80
getMemorySettingMethod · 0.80
runMethod · 0.80
infoMethod · 0.80
getInfoMethod · 0.80
getIntegerMethod · 0.80
parseListMethod · 0.80
s2intsMethod · 0.80
safeParseMethod · 0.80

Calls 7

getFirstStringMethod · 0.95
parseDoubleMethod · 0.95
getCommaMethod · 0.80
getExpressionMethod · 0.80
getRightParenMethod · 0.80
nextTokenMethod · 0.45
roundMethod · 0.45

Tested by 4

longStringTestAnyMethod · 0.64
serveMethod · 0.64
flexFormatTestMethod · 0.64
testIntMethod · 0.64