0
> num.1.2[2*2^1/3 - 1/2 - (-1)^1/6]
numeric(0)
> 2*2^1/3 - 1/2 - (-1)^1/6
[1] 1
> num.1.2[1]
[1] 1

Where is the mistake? I don't see it.

MrFlick
  • 195,160
  • 17
  • 277
  • 295
yosu
  • 1
  • There is probably a floating point rounding issue. Try: `num.1.2[round(2*2^1/3 - 1/2 - (-1)^1/6)]` – Dave2e Mar 31 '20 at 15:30
  • 1
    `2*2^1/3 - 1/2 - (-1)^1/6` is not exactly equal to 1 when you use floating point math. If you want to index your vector, be sure to make sure that index is an integer. Perhaps use `round()` is that's appropriate for your calculations. A longer discussion of the issue can be found here: https://stackoverflow.com/questions/9508518/why-are-these-numbers-not-equal – MrFlick Mar 31 '20 at 15:30

0 Answers0