The Artima Developer Community
Sponsored Link

Java Answers Forum
java.math (Mod )

2 replies on 1 page. Most recent reply: Feb 26, 2002 9:19 AM by sylvain

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic    
Flat View: This topic has 2 replies on 1 page
sylvain

Posts: 2
Nickname: ketchup
Registered: Feb, 2002

java.math (Mod ) Posted: Feb 26, 2002 8:33 AM
Reply to this message Reply
Advertisement
Hi i am new to java programming
can sombody tell me how the function mod work look at my code at tell me what is wrong

int a,b,c;
c= mod(a, b);

thanks
to all


Charles Bell

Posts: 519
Nickname: charles
Registered: Feb, 2002

Re: java.math (Mod ) Posted: Feb 26, 2002 8:47 AM
Reply to this message Reply
Hi,

Where is your function mod?
What's it supposed to do? What class is a part of?

There is only one method called mod in the Java API documentation:
public BigInteger mod(BigInteger m)

If you are trying to get the integer modulo you could create a function in the class your are writing such as the following:

/** Returns n modulo p
*/
public int mod(int p, int q){
return n%p;
}

sylvain

Posts: 2
Nickname: ketchup
Registered: Feb, 2002

Re: java.math (Mod ) Posted: Feb 26, 2002 9:19 AM
Reply to this message Reply
Tanks Charles 4 your tips

well i just wanted to know how mod works
but now i know

i wase dooing that
c=a mod b;
but it's
c=a%b;
Thanks agen and sorry for my bad english

Flat View: This topic has 2 replies on 1 page
Topic: sorting arrays Previous Topic    

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use