Welcome! Log In Create A New Profile


fmod() function

Posted by ngoqoza 
Announcements Last Post
Announcement SoC Curricula 09/30/2017 01:08PM
Announcement Demarcation or scoping of examinations and assessment 02/13/2017 07:59AM
Announcement School of Computing Short Learning Programmes 11/24/2014 08:37AM
Announcement Unisa contact information 07/28/2011 01:28PM
fmod() function
August 15, 2012 05:36PM
Hi mac,
my fmod page works well, but there is one thing that worries me, when I click the link of my fmod page on a menu, it gives me a warnig: Warning: fmod() expects parameter 1 to be double, string given in C:\Program Files\EasyPHP-5.3.3\www\fmod.php on line 41, but everything works well, here is my code
Language: PHP
EDITED: You cannot post ALL your code here!!!...
avatar Re: fmod() function
August 16, 2012 09:03AM
Just use a form that will allowed a user to enter the number (value for $x and $y), because what I see here is you assign the value $x to a string "undefined" why?
see below:
Language: PHP
$x = $_POST['x']; $y = $_POST['y'];
This way you'll not going to get that warning anymore, remember that you'll get those values from the form.
Re: fmod() function
August 20, 2012 09:23PM
Try to be specific in your posts Ngogosa.
avatar Re: fmod() function
August 21, 2012 10:21AM
fmod() expects you to pass it two floats as arguments. http://ca.php.net/manual/en/function.fmod.php

To the best of my knowledge when you capture data from a form you get a string type.

You can check your variables for their type using gettype()

You need to do type casting or juggling to solve your problem
Sorry, only registered users may post in this forum.

Click here to login