| To: | "James Carman" <james@xxxxxxxxxxxxxxxxxxxx> |
|---|---|
| Subject: | Re: [cinjug-users] Java vs. C |
| From: | "josh marotti" <marotti@xxxxxxxxx> |
| Date: | Mon, 15 Oct 2007 14:54:10 -0400 |
| Cc: | "Hudson, Loren (GE Infra, Aviation, Non-GE, US)" <loren.hudson@xxxxxx>, users@xxxxxxxxxx |
| Delivered-to: | mailing list users@xxxxxxxxxx |
| Dkim-signature: | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=h+q+vc2LEYhUW4WqwyQcA/zGe62cs8B4eRQDgwakQ0g=; b=WnYl/rQzn90DmWXyoAEIXTfMjxCIvFQwO5+k/kP/xhJHxRsk61p8k8bxvnnphWe+5NhGEkzgPXoPm0FcC5eg9kZ2JvO8/aVyz51h2FzDVRhZUZGZB+icg+z2m4gLepRdfgrJ52RbxnvYZsDiDellRfcy1xZEraqcgV1fzIQCY4A= |
| Domainkey-signature: | a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=QLRC5ZFfaWJZg6kq3wSKd36cpyE9nCaVvDe1FFiyUOb352N++NS/nel8wuR60s59uwWuGnpuRzaB29jKhF9dAecrd+qDa9eFLRrbThmVZmGcAkFvQiTpZNNIljBT5dJiIdpaIeAyfNsjSmDoeEhZ8KqCy9VyIZ06BHEgmlh8lBI= |
| In-reply-to: | <f2e8eedf0710151148h5f6ac4elf0b9c939850e147c@xxxxxxxxxxxxxx> |
| Mailing-list: | contact users-help@xxxxxxxxxx; run by ezmlm |
| References: | <751717.27922.qm@xxxxxxxxxxxxxxxxxxxxxxxxxxx> <0BE974242D712B4B86B49792A69D789C02C37DF5@xxxxxxxxxxxxxxxxxxxxxxxx> <f2e8eedf0710151148h5f6ac4elf0b9c939850e147c@xxxxxxxxxxxxxx> |
And don't forget the rounding rules that Java uses (if you are dealing with floats/doubles/bigdecimals): http://java.sun.com/j2se/1.5.0/docs/api/java/math/BigDecimal.html#ROUND_HALF_EVEN -Josh On 10/15/07, James Carman <james@xxxxxxxxxxxxxxxxxxxx> wrote: > Is the old code making any assumptions about the size of an int when > doing the bit shifting? > > On 10/15/07, Hudson, Loren (GE Infra, Aviation, Non-GE, US) > <loren.hudson@xxxxxx> wrote: > > > > > > All, > > > > I'm currently working on porting some C code over to Java. The code opens a > > binary file, extracts the relevant data, and spits out a .csv file. I'm > > getting some issues with the totals being off. > > > > The code was originally written by an engineer, not a programmer. This is > > the fourth such program I've ported, and haven't had any real issues. For > > the most part, I just wrap the already-written C code with some Java data > > structures, change the file i/o to use Java commands, and I'm done. The > > program uses bit masking, bit shifting, and a whole host of global > > variables. > > > > My question is this: Are there any pitfalls that you know of that I could > > be falling into with the C code that compiles as Java code? I've never used > > C before, so this program is really the extent to which I know C. > > > > Thanks, > > Mike Hudson > > MDW - Military Data Warehouse > > Java Developer/Solution Architect > > Sogeti Consultant > > loren.hudson@xxxxxx > > > > --------- > You may unsubscribe from this mailing list > by sending a blank email addressed to: > users-unsubscribe@xxxxxxxxxx > > -- > Find additional help by sending a blank email > addressed to: > users-help@xxxxxxxxxx > > |
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | Re: [cinjug-users] Java vs. C, James Carman |
|---|---|
| Next by Date: | RE: [cinjug-users] Java vs. C, Hudson, Loren (GE Infra, Aviation, Non-GE, US) |
| Previous by Thread: | Re: [cinjug-users] Java vs. C, James Carman |
| Next by Thread: | CodeMash 2008, Matt Insko |
| Indexes: | [Date] [Thread] [Top] [All Lists] |