Timeline for Interpret StackyMath!
Current License: CC BY-SA 3.0
28 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Dec 4, 2015 at 17:12 | comment | added | manatwork | Now it works like in Ruby: 64,2^1000+ passes and gets calculated, 64,2^10000+ raises the exception. I strongly believe there is no better solution given the machine's internal floating point representation. | |
| Dec 4, 2015 at 17:08 | comment | added | J Atkin | @manatwork That should fix it. Thanks for catching that problem. | |
| Dec 4, 2015 at 17:07 | history | edited | J Atkin | CC BY-SA 3.0 | added 116 characters in body |
| Dec 4, 2015 at 16:59 | comment | added | J Atkin | I'm not sure I can fix it now, It's a little late to change the question ;) I will go ahead and fix my answer though. | |
| Dec 4, 2015 at 16:54 | comment | added | manatwork | If you ask me, that 64 bit thing is the requirement's issue. ;) In a certain degree it should appear in most of the languages. (For my Ruby solution there would be a trick to use Rational instead, but then you get higher precision for the result too, not just the error checking. I mean, 654,489,48,43/5*7D+-*% would result 77.6875.) | |
| Dec 4, 2015 at 16:54 | comment | added | J Atkin | @manatwork Weird, Double has Double.MAX_EXPONENT, set to 1023. So 2d**1024d is Infinity, but 2d**64d is just fine... | |
| Dec 4, 2015 at 16:51 | comment | added | J Atkin | Quite odd. It looks like I'm using double (getClass().getSimpleName() is Double) but increasing the value has no effect. Is double replaced with BigDecimal in groovy? | |
| Dec 4, 2015 at 16:42 | comment | added | J Atkin | I'm not sure what is going on when I do that. It would seem that I'm using big decimal instead of double.... I'll see if I can fix that soon. | |
| Dec 4, 2015 at 16:36 | comment | added | manatwork | Not getting NumberOverflowException when calculating 65,2^ is also a version difference? | |
| Dec 4, 2015 at 16:27 | comment | added | J Atkin | It looks like you would need 1.8.7 min (from the docs) but I'm not sure. I am using groovy 2.4.5 right now. | |
| Dec 4, 2015 at 16:22 | comment | added | manatwork | Does it require a specific version of Groovy? The 1.8.6 I use raises exception on factorial: “groovy.lang.MissingMethodException: No signature of method: groovy.lang.ObjectRange.inject()”. | |
| Dec 4, 2015 at 0:42 | history | edited | J Atkin | CC BY-SA 3.0 | deleted 178 characters in body |
| Dec 4, 2015 at 0:41 | comment | added | J Atkin | Nope, still doesn't work. Perhaps it's a bash feature. | |
| Dec 4, 2015 at 0:24 | comment | added | a spaghetto | I use Linux. I'm not sure why Ctrl-D would quit the process (it just means EOF). Try giving your input like this: groovy script <<< INPUT | |
| Dec 3, 2015 at 23:31 | comment | added | J Atkin | @quartata as it turns out my skills + python + this challenge is more than 900 bytes, so I plan to keep this one. Oh and for some reason Ctrl-D quits the process, not end the std in. Do you use OSX or lunix? | |
| Dec 3, 2015 at 18:02 | history | edited | J Atkin | CC BY-SA 3.0 | deleted 8 characters in body |
| Dec 3, 2015 at 17:48 | history | edited | J Atkin | CC BY-SA 3.0 | deleted 342 characters in body |
| Dec 3, 2015 at 3:01 | comment | added | J Atkin | Right, forgot about Ctrl-D. I almost never use the command line. It doesn't matter since I will remove this shortly in favor of the python answer I'm working on. | |
| Dec 3, 2015 at 1:50 | comment | added | a spaghetto | Right, but this is code-golf. It's not a big deal if people have to type Control-D after their input. | |
| Dec 3, 2015 at 0:52 | comment | added | J Atkin | Not really. .text is greedy and as long as data in in the reader, it won't return. | |
| Dec 3, 2015 at 0:47 | comment | added | a spaghetto | You can use System.in.text instead of System.in.newReader().readLine(). | |
| Dec 3, 2015 at 0:34 | history | edited | J Atkin | CC BY-SA 3.0 | deleted 50 characters in body |
| Dec 3, 2015 at 0:15 | history | edited | J Atkin | CC BY-SA 3.0 | edited body |
| Dec 2, 2015 at 21:54 | history | edited | J Atkin | CC BY-SA 3.0 | added 46 characters in body |
| Dec 2, 2015 at 21:24 | history | edited | J Atkin | CC BY-SA 3.0 | deleted 68 characters in body |
| Dec 2, 2015 at 21:22 | comment | added | J Atkin | Whoops, just noticed many more places to remove whitespace. Thanks for the tip. | |
| Dec 2, 2015 at 21:13 | comment | added | Doorknob | I don't know Groovy, but you seem to have lots of unnecessary whitespace. For example, around operators, after for/if, etc | |
| Dec 2, 2015 at 20:55 | history | answered | J Atkin | CC BY-SA 3.0 |