Advertisement

11.30.2002 at 02:23AM PST, ID: 20411519
[x]
Attachment Details

Translating from C to Visual Basic

Asked by ozo in Visual Basic Programming, Microsoft Programming

Tags: visual, c, basic

/* Could someone please translate this C code into a Visual Basic equivalent */
#include <stdio.h>
#include <math.h>
#include <float.h>
int cf(double v, double p, int *N, int *D){
       int i;
       i=v;
       v -= i;
       v=fabs(v);
       if( v>p ){
               int a,n,d;
               a=cf(1/v,p+p/v,&n,&d);
               *N=d;
               *D=d*a+n;
       }else{
               *N=0; *D=1;
       }
       return i;
}
main(int argc,char *argv[]){
 int i,n,d;
 i=cf(27.0/26.0,FLT_EPSILON,&n,&d);
 printf("%d %d/%d\n",i,n,d);
}
Start Free Trial
[+][-]11.30.2002 at 04:15AM PST, ID: 7514037

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11.30.2002 at 11:05AM PST, ID: 7514968

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11.30.2002 at 12:40PM PST, ID: 7515217

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11.30.2002 at 12:46PM PST, ID: 7515227

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Visual Basic Programming, Microsoft Programming
Tags: visual, c, basic
Sign Up Now!
Solution Provided By: twalgrave
Participating Experts: 2
Solution Grade: A
 
 
[+][-]11.30.2002 at 01:52PM PST, ID: 7515398

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11.30.2002 at 02:09PM PST, ID: 7515444

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11.30.2002 at 02:15PM PST, ID: 7515457

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11.30.2002 at 02:28PM PST, ID: 7515479

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11.30.2002 at 02:32PM PST, ID: 7515486

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11.30.2002 at 02:37PM PST, ID: 7515501

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32