function readOnly(count){ }
Don't have an account?
Search for an answer or ask a question of the zone or Customer Support.
You need to sign in to do that
Sign in to start searching questions
Signup for a Developer Edition
Sign in to start a discussion
I tried with mod(integer,integer) and integer %10 but errors are thrown
what can i do to get remainder when division operation is performed
Hi,
I don't think apex has a modulus operator , hence the error.
Try going though the documentation in the following link page 32- 37 :-
http://wiki.developerforce.com/images/3/3e/Salesforce_apex_language_reference.pdf
Hope this helps.
hi jayam,
to perform modular operation between two numbers say 'a' and 'b'
try using
sum = math.mod(a,b);
//system.debug(sum);
// 100 % 97
Integer reminder = math.mod(100, 97);
// reminder = 3
yes this works fine thanks:)
Hi,
I don't think apex has a modulus operator , hence the error.
Try going though the documentation in the following link page 32- 37 :-
http://wiki.developerforce.com/images/3/3e/Salesforce_apex_language_reference.pdf
Hope this helps.
hi jayam,
to perform modular operation between two numbers say 'a' and 'b'
try using
sum = math.mod(a,b);
//system.debug(sum);
// 100 % 97
Integer reminder = math.mod(100, 97);
// reminder = 3
yes this works fine thanks:)
% operator doesnot exist in salesforce but we can access this using math class like:
result = math.mod(x,y);
you can use anywhere like :
integer x=21,y;
y=math.mod(x,5);
system.debug('Remainder is :'+y); // Result is 1
resto = Math.mod(Integer.valueOf(quantidade * 100000), Integer.valueOf(multiplo * 100000));
System.debug(remainder);