unix - How to check if a number is an integer in Pari/GP? -


i'm trying write if statement this

 if(denominator([(i-1)! + 1] / i)-1,print(hi),print(ho)) 

i can integer example 10, when set i 10 gives error.

? [(x-1)! + 1] / x   ***   should integer: [(x-1)!+1]/x                                     ^----------- 

i need check if [(x-1)! + 1] / x integer or not denominator thing came with, tried mod couldn't working either.

it seems confused names x , i. please, see expression below works properly:

i = 10; print([(i-1)! + 1] / i); gp > [362881/10] 

Comments

Popular posts from this blog

Django REST Framework perform_create: You cannot call `.save()` after accessing `serializer.data` -

Why does Go error when trying to marshal this JSON? -