Skip to content

lerp overflows #31

@GoogleCodeExporter

Description

@GoogleCodeExporter
What steps will reproduce the problem?
1. fix16_lerp16(fix16_from_int(0), fix16_from_int(10),32768)

What is the expected output? What do you see instead?
expected fix16 version of 5 (327680), actual is 0.

What version of the product are you using? On what operating system?
revision 91,  MacOS Mavericks Xcode 5.1.1

Please provide any additional information below.
The MACRO
static inline int64_t int64_mul_i32_i32(int32_t x, int32_t y) { return (x * y); 
 }

needs to coerce the int32_t values to int64_t.  
Also, the unit tests do not cover lerp functions at all.

Original issue reported on code.google.com by [email protected] on 11 Aug 2014 at 8:35

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions