Note: This discussion is about an older version of the COMSOL Multiphysics® software. The information provided may be out of date.

Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.

integer function

Please login with a confirmed email address before reporting spam

Hello All,

Does anyone know if it is possible to use the integer function in comsol? I have found the "round" and "ceil" and "floor" but none of them are giving me the same results as an integer function would.. I thought I would be able to use int(x) but comsol uses that for interpolation! Any ideas?
Thank you.

Kelley

1 Reply Last Post 18 sept. 2012, 15:56 UTC−4
Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 18 sept. 2012, 15:56 UTC−4
Hi

if nothing else work, try:

my_int() = sign(x)*floor(abs(x))

and probably

my_other_int = x - mod(x,1)

should also work

But indeed I see no "int" at p 143 of the user guide (v4.3)

--
Good luck
Ivar
Hi if nothing else work, try: my_int() = sign(x)*floor(abs(x)) and probably my_other_int = x - mod(x,1) should also work But indeed I see no "int" at p 143 of the user guide (v4.3) -- Good luck Ivar

Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.