0
$\begingroup$

I had a bug in my code which I tracked down to the simple number 0.805. So I looked at the FullForm of this number and I got

Times[0.805`, \.00]

It isn't a big deal, but I'm just curious what happened.

Here is more information. On an input line

  1. type: Times[0.805,.0
  2. then enter one more character: 0

On the screen, instead of Times[0.805,.00 , I see: Times[0.805,

In other words, when I press the key for the last character (i.e., 0), three previous characters disappear. Seems like a bug to me.

  1. Then on the same line I finally type: ] and press return. I get the output 0.805. Looks fine. But when I type FullForm[%] I see everything I typed, i.e.

Times[0.805`,.00]

$\endgroup$
3
  • 2
    $\begingroup$ Please read the bugs info for its appropriate use. $\endgroup$
    – Michael E2
    Commented Feb 8, 2021 at 17:04
  • 2
    $\begingroup$ What does the menu command Cell > Show Expression reveal about the cell containing the expression? You may have entered a strange unicode character or something. I can't paste what you've shown and get the same thing. $\endgroup$
    – Michael E2
    Commented Feb 8, 2021 at 17:05
  • $\begingroup$ @Michael I added to my question. $\endgroup$
    – Chris
    Commented Feb 8, 2021 at 17:52

1 Answer 1

5
$\begingroup$

It sounds like you entered \.00, which matches the syntax for a character specified by hexadecimal character code. In this case, it's the null character (NUL; character code 0).

From the documentation:

∖[Name] - a character with the specified full name
∖nnn - a character with octal code nnn
∖.nn - a character with hexadecimal code nn
∖:nnnn - a character with hexadecimal code nnnn
∖|nnnnnn - a character with hexadecimal code nnnnnn

$\endgroup$
2
  • $\begingroup$ The experiment I described above indicates that if you ever type these four characters together in this order (\.00), then Mathematica automatically makes the substitution of a blank space. I'm not sure how I ever made the mistake of putting those four characters down like that. I would suggest that this substitution should not be so automatic, because it hides your misstake. $\endgroup$
    – Chris
    Commented Feb 8, 2021 at 21:15
  • 2
    $\begingroup$ @Chris Mathematica is not substituting a blank space; it's converting the escape sequence for a NUL character into a NUL character, which happens to look the same as a blank space. I think the fact that this conversion is automatic is rather the point. I might agree with a suggestion that certain unprintable characters, such as NUL, be rendered in a visible form like they are in some text editors. $\endgroup$ Commented Feb 9, 2021 at 22:44

Not the answer you're looking for? Browse other questions tagged or ask your own question.