MCPcopy Create free account
hub / github.com/Aghajari/MathParser / fixBinary

Method fixBinary

MathParser/src/com/aghajari/math/MathParser.java:304–313  ·  view source on GitHub ↗

(0b010) -> (2)

(String src)

Source from the content-addressed store, hash-verified

302 * (0b010) -> (2)
303 */
304 private String fixBinary(String src) {
305 Matcher matcher = Utils.binary.matcher(src);
306 if (matcher.find()) {
307 String a = matcher.group(0);
308 long value = Long.parseLong(a.substring(3, a.length() - 1), 2);
309 src = src.substring(0, matcher.start() + 1) + value + src.substring(matcher.end() - 1);
310 return fixBinary(src);
311 }
312 return src;
313 }
314
315 /**
316 * (0x0FF) -> (255)

Callers 1

firstSimplifyMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected