[Date Index] [Thread Index] [Author Index]
Just for fun: Shortest InputForm to achieve a given Kernel error
"1/0" is a string of length 3 which, when interpreted as InputForm (in a clean Kernel), generates a Power::infy error: ToExpression["1/0", InputForm]; >> Power::infy: Infinite expression 1/0 encountered. I think this is the shortest string with this property. Here are some other errors and the lengths of the shortest strings I can find to generate them: $RecursionLimit::reclim: Recursion depth of 256 exceeded. Input length: 4 General::ovfl: Overflow occurred in computation. Input length: 5 (Kernel running out of memory) Input length: 5 General::unfl: Underflow occurred in computation. Input length: 6 $IterationLimit::itlim: Iteration limit of 4096 exceeded. Input length: 7 Can you figure out how to generate those errors with input strings of that length? Can you find any *shorter* solutions?