Changeset e752e4e


Ignore:
Timestamp:
Dec 12, 2019, 11:09:31 AM (23 months ago)
Author:
Dmitry Kobets <dkobets@…>
Branches:
arm-eh, jacob/cs343-translation, master, new-ast-unique-expr
Children:
99905f4
Parents:
2fa5bd2
Message:

Fix vec2_float tests

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/vec/vec2.hfa

    r2fa5bd2 re752e4e  
    11#pragma once
    22
     3#include <iostream.hfa>
    34#include "vec.hfa"
    45
     
    5455
    5556    forall(| negate(T)) {
    56     vec2(T) -?(vec2(T)& v) with (v) {
     57    vec2(T) -?(vec2(T) v) with (v) {
    5758        return [-x, -y];
    5859    }
     
    113114    } // static inline
    114115}
     116
     117forall(dtype ostype, otype T | writeable(T, ostype)) {
     118    ostype & ?|?(ostype & os, vec2(T) v) with (v) {
     119        return os | '<' | x | ',' | y | '>';
     120    }
     121    void ?|?(ostype & os, vec2(T) v ) with (v) {
     122        (ostype &)(os | v); ends(os);
     123    }
     124}
     125
  • tests/vector/vec2_float.cfa

    r2fa5bd2 re752e4e  
    8181
    8282    v2 = (vec2(float)){0,-1};
    83     sout | "refract:" | refract(v1,normalize(v2),1);
     83    sout | "refract:" | refract(v1,normalize(v2),1.f);
    8484    sout | "refract:" | refract(v1,normalize(v2),1.f/1.33f);
    8585
Note: See TracChangeset for help on using the changeset viewer.